package com.ideabove.heart;



import com.ideabove.heart.game.framework.GameView;
import com.ideabove.heart.manager.AppManager;
import com.ideabove.heart.util.LogUtil;

import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.app.Activity;
import android.content.Intent;

public class MoeActivity extends MyActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
//		setContentView(R.layout.alarm_setting);

		AppManager.pause(MoeActivity.this);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
		getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED 
				| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD 
				| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON 
				| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); 
		AppManager.getInstance().setActivity(this);
		setContentView(new GameView(this));
		
		overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
		
//		ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
//		List<RunningTaskInfo> taskList = activityManager.getRunningTasks(100);                
//		                
//		for(int i = 0 ; i < taskList.size() ; i++){
//		    String pkgName = taskList.get(i).baseActivity.getPackageName();
//		    LogUtil.e( "baseActivity = " + pkgName);
//		            
//		    String pkgName2 = taskList.get(i).topActivity.getPackageName();
//		    LogUtil.e("topActivity = " + pkgName2);
//		}
	}


	@Override
	protected void onNewIntent(Intent intent) {		
		super.onNewIntent(intent);
		setIntent(intent);
	}
	
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onStart();
		AppManager.pause(MoeActivity.this);
	}
	
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		AppManager.pause(MoeActivity.this);
	}

	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
		
		finish();
	}
	
	@Override
	protected void onDestroy(){
		super.onDestroy();
	}
}
